package com.edu.pay;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id = "2021000116687523";
	
	// 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCXO5lHBdojhw0Udt/MOmnZN2eJyea2aI/x7INs19zXjHnfAGSKpy9Q4u/UlcgaB4SadqfY2du+g7n7qKrr4d8BbrV+z0i+c0JN9TJLs5eEM9aHjNoIwOPX2fgQvVAIF/jopstE17ypjAIO1BeC4dda3XfTMLapCfOLqdUNtvhJ4jc7+Bijl7XbDryG15uBnyMXLp+XkzRLL2bsb9C2fGpMuGNo7thVbGTQDmfCjaAcy9ZrxjbJ6hkOKHIj9818vuNUwzXLmVyWOCxuIjJ16thRVTETX6qpMZOmCDnj6033nbWdLSEY6Azsqqq3S3mKFcazSpS3IN42FgeSZejXKaXrAgMBAAECggEAKixwniG/p1CuERrlZiqUAgM1WHN5ZzzZh3mRXPUFnQaLpeiSIShmRYRDpWDvoHKgRAL647o9UW+imc97erROYDPjYS2k95dk0iCimgHHKxLZrItW8kH4R+V9DA3/F4K34wlAfj47Wny0xjXXKKSaTbidBcP77D/eLwB5bY2sx81ilD0btAoMufiHSqp2X3FmmafItPiv//kZIzq29W59tS8NWyE0M0PHmyL3Y7kuHxEQWd2YUBcbJxGoNXkDKP0Wd2ISJ6NGmfhnUO5KMJ5xwB0fFXMQDJtbz5rAwTZRpPKERaNiTB+U7EDzdXz30hgpic71Mj/W42zMcRvPMmAr4QKBgQDo3QFiR3bLfdQeoaNRnaxeTszsNq0MorTrb06PQbASFf/SlWvJTQuIH0LrT/NFilRdHvQAyNEJgJd8xQxKaA6BoGTxVcTH+2SL40v0MVqBEPK/iQeG/jVZRGJyDiao3WBxUvDDi9JRRpAMBE5b+pvzSMwa9Jd69R3gkGjevcnNhQKBgQCmQkfmeS733ffBbfLGeVOr6zLh/BT7cP5cYz8IanfrduuhGa5vZblnqNvPueu9PLJQMHFcasc2PTVNzEXhEhuvsP+5Qiah+nvBIgnqPQwFd96sOT05WyaxWN77YgYMNSGgg0dneawaLGGOwKdteNcQhFEa/yV4f9bRCAk/6cIIrwKBgHnDXr7iOYcMg8eEo97AgOpLcDIwIOrThaD6cezM32GFqWCXC2aWZ+pE1nwvMTjyrUyIK/ThDRVX7V6rttKNeNBla4MaYyxjEt9m+kd1KysEDrsCzzHSaVkFPij/p01zfMOlKApIabBgImB2O/cyoytirH+H2FHOLFJJkNywBv71AoGBAIdQbKpkuNhdnNaeQLhOaM4EZ+5LN1yJ00uoLtYPqThIGnCMsU7S8PowEW7Yd8gVzV68fpbkBOzdFjQSbFFJZqUwnoDOGRk9/1jp9j3hn5YXwHBVScITsMMofJsGZburxomYLxZFjc/jjScdH2dWsVstBcG+JWYUTebk7npJK3XbAoGAE2807ThXTQzFFEGOSJqt+kjr3mnVUgfGIv8rbsGY/pjwkYob3s9WP08dCz6NwMwxe1hk6mXVRnpbjKPUbie0ZncMh/V33/suikZ12SZMNUN1ZOvcMGpI1nhj3uyXnuYBqDqJhtGAiT5lZMMwlvogKRQ3AjjHpqA0EfOS/RTqm5U=";

	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmEexLmk3lXapXHSSkTUX2mywS0Gj/z31UJWBuaZvElDoucI3y/FKyKliyVv/X6wRuZoBkOBufBFFd7xeKkbVRhsgT/HRe0VlH+WuEbZVgcNR36F/lQ1OLVF1h1McX95ANm80g6WRncyd1nLZCUUVzXIWc7pHYNl2bTTaSRwfQsy4SyDhJwB4s3lx5T+6wtURq1vFvHWKvZArmTxZ1wGqEjee+bTgFX5qAoADBsvsSpv1izGl89gPJmTy/1mC3PCD82NUjEApBn4lUjPsbARRnAMebCuI5GYhwVBJumy1i7/xYjwfCtm7JopakC15SX5A44II2JlowLc0YnXIkuZTUwIDAQAB";

	// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url = "http://localhost:8080/alipay.trade.page.pay-JAVA-UTF-8/notify_url.jsp";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String return_url = "http://www.tian.com:801/paysuccess.html";

	// 签名方式
	public static String sign_type = "RSA2";
	
	// 字符编码格式
	public static String charset = "utf-8";
	
	// 支付宝网关
	public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";
	
	// 支付宝网关
	public static String log_path = "F:\\1804\\zheng";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /** 
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

